﻿// ReSharper disable InconsistentNaming
using System;
using NEasy.Ldap;
using NEasyLdap.Tests.Entity;
using NUnit.Framework;

namespace NEasyLdap.Tests.BasicAccessTests
{
    [TestFixture()]
    public class Create_MinimumPrincipalComment_In_AD_
    {
        private LdapRepository sut;

        [SetUp()]
        public void Setup()
        {
            Console.WriteLine();

            sut = new LdapRepository(
                new LdapDomainInfo("mentzel.org", "CN=Users,DC=Mentzel,DC=org"));
        }

        [TearDown()]
        public void TearDown()
        {
        }

        [Test()]
        public void Add_Valid_User()
        {
            var user = new MinimumPrincipal()
                           {
                               CanonicalName = "Test",
                               SAMAccountName = "Test",
                           };

            sut.SaveNew(user);

            var tst = sut.Find(user);
            Assert.That(tst, Is.Not.Null);
        }
    }
}
